|
|
|
 | You now have the Employee Information form back to looking the way you wantnow lets learn how to program it. Now that you have added normal controls where you once had data aware controls, you will now be ready to program these. |
|
|
|
|
|
|
Now that you have the screen redesigned, lets add code to get the form to work with ADO objects. |
|
|
|
|
| Adding a Recordset Object 1. Add a module-level Recordset object to this form. 2. Add code to the Form_Load() event, as shown here: | | Dim moRS As Recordset
Private Sub Form_Load()
Set moRS = New Recordset
Call StateLoad
Call HealthCareLoad
Call ListLoad
End Sub |  | In the Form_Load() event, you create a new instance of the module-level recordset, call a procedure to load state codes into the State combo box, call aprocedure to load the health care plans into the Health Care Choices grid, and load the Employee list box. Each of these routines load the appropriate controls with the appropriate data. The code youll write to load combo boxes, grids, and list boxes are all very similar. |
|
|
|